<?php
class contentApi extends baseApi{

	//权限
	public function hook_purview_admin()
    {
        return array(
            'admin_category'=>array(
                'name'=>'文章栏目',
                'auth'=>array(
                    'add'=>'添加',
                    'edit'=>'编辑',
                    'del'=>'删除',
                ),
            ),
            'admin_content'=>array(
                'name'=>'文章列表',
                'auth'=>array(
                	'list'=>'列表',
                    'add'=>'添加',
                    'edit'=>'编辑',
                    'del'=>'删除',
                ),
            ),
        );
    }

    //列表标签
	public function hook_label_list(){
		return array(
			'content'=>array(
				'app'=>'content',
				'action'=>'label_content_list',
			),
			'category'=>array(
				'app'=>'content',
				'action'=>'label_category_list',
			),
		);
	}

    public function label_content_list($data){
    	return model('label_content')->content_list($data['data']);
    }

    public function label_category_list($data){
    	return model('label_category')->category_list($data['data']);
    }

    
	//内容列表
	public function content_list($data)
    {
    	return model('admin_content')->content_list($data['limit'],$data['where'],$data['order']);
    }

    //内容总数
    public function content_count($where=null)
    {
    	return model('admin_content')->count($where);
    }

    //内容超链接
    public function content_aurl($data)
    {
    	return model('label_content')->get_aurl($data);
    }

    //栏目超链接
    public function category_curl($data)
    {
    	return model('label_category')->get_curl($data);
    }

	
}